local CATEGORY_NAME = "Fun"
function ulx.decals(calling_ply)
	for k,v in pairs(ents.GetAll()) do
		if v:IsPlayer() then
			v:ConCommand("r_cleardecals")
		end
	end
end
local decals = ulx.command( CATEGORY_NAME, "ulx decals", ulx.decals, "!decals" )
decals:defaultAccess( ULib.ACCESS_ADMIN )
decals:help( "Clears All Decals" )
decals:logString( "Decals Cleared" )
ulx.addToMenu( ulx.ID_MCLIENT, "Decals", "ulx decals" )

function ulx.astrip( calling_ply, target_plys)
	for _, v in ipairs( target_plys ) do
		ulx.logUserAct( ply, v, "#A astripped #T's weapons" )
		v:StripWeapons()
		if not v:HasWeapon( "weapon_physgun" ) then
			v:Give( "weapon_physgun" ); 
			v:Give( "gmod_tool" ); 
			v:Give( "gmod_camera" );
		end
		v.loadout = 1
	end
end
local astrip = ulx.command( CATEGORY_NAME, "ulx astrip", ulx.astrip, "!astrip" )
astrip:addParam{ type=ULib.cmds.PlayersArg }
astrip:defaultAccess( ULib.ACCESS_ADMIN )
astrip:help( "Astrips <user(S)>" )
astrip:logString( "#1 astripped #2" )
ulx.addToMenu( ulx.ID_MCLIENT, "Astrip", "ulx astrip" )

function ulx.give( calling_ply, target_plys)
	for _, v in ipairs( target_plys ) do
		if not v:Alive() then
			ULib.tsay( ply, v:Nick() .. " is dead!", true )
			return
		end
		if v.jail then
			ULib.tsay( ply, v:Nick() .. " is in jail", true )
			return
		end
		if v.ragdoll then
			ULib.tsay( ply, v:Nick() .. " is a ragdoll", true )
			return
		end	
		if v.rocket then
			ULib.tsay( ply, v:Nick() .. " is already being rocketed", true )
			return
		end
		ulx.logUserAct( ply, v, "#A gave #T weapons" )
		if not v:HasWeapon( "weapon_physgun" ) then
			v:Give( "weapon_physgun" ); 
			v:Give( "gmod_tool" ); 
			v:Give( "gmod_camera" );
		end
		v:Give( "weapon_pistol" ); 
		v:Give( "weapon_357" );
		v:Give( "weapon_smg1" );
		v:Give( "weapon_ar2" );
		v:Give( "weapon_crossbow" );
		v:Give( "weapon_shotgun" );
		v:Give( "weapon_rpg" );
		v:Give( "weapon_frag" );
		v:Give( "weapon_physcannon" );
		v:Give( "weapon_crowbar" );
		v:SelectWeapon("weapon_physcannon")
		v.loadout = 0
	end
end
local give = ulx.command( CATEGORY_NAME, "ulx give", ulx.give, "!give" )
give:addParam{ type=ULib.cmds.PlayersArg }
give:defaultAccess( ULib.ACCESS_ADMIN )
give:help( "Gives weapons to <user(S)>" )
give:logString( "#1 gave #2 weapons" )
ulx.addToMenu( ulx.ID_MCLIENT, "Give", "ulx give" )

function ulx.shoveMOTD(calling_ply, target_plys)
	for _, v in ipairs( target_plys ) do
		v:ConCommand( "ulx motd" )
	end
end
local shoveMOTD = ulx.command( CATEGORY_NAME, "ulx shoveMOTD", ulx.shoveMOTD, "!shove" )
shoveMOTD:addParam{ type=ULib.cmds.PlayersArg }
shoveMOTD:defaultAccess( ULib.ACCESS_ADMIN )
shoveMOTD:help( "Shove the MOTD at <user(S)>" )
shoveMOTD:logString( "#1 Shoved the MOTD in #2's Face" )
ulx.addToMenu( ulx.ID_MCLIENT, "shoveMOTD", "ulx shoveMOTD" )
function loadoutCheck(ply) 
	if ply.loadout == 0 then
		return
	end
	if ply.loadout == 1 then
		ply:Give( "weapon_physgun" ); 
		ply:Give( "gmod_tool" ); 
		ply:Give( "gmod_camera" );
		return true
	end
	if ply.loadout == 2 then
		return true
	end
end	
hook.Add( "PlayerLoadout", "ahrefLoadoutCheck", loadoutCheck)